package com.zzyl.nursing.task;

import com.zzyl.nursing.service.IContractService;
import com.zzyl.nursing.service.IReservationService;
import com.zzyl.nursing.service.impl.ReservationServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component("taskContract")
@Slf4j
public class TaskContract {

    @Autowired
    private IContractService contractService;

    @Autowired
    private IReservationService reservationService;

    /**
     * 每天凌晨一点更新合同状态
     */
    public void AutoUpdateContractStatus() {
        contractService.updateContractStatus();
        log.info("定时更新合同状态成功！");
    }

    /**
     *
     */
    public void AutoUpdateReservationStatus() {
        reservationService.autoupdataStatus();
        log.info("定时更新预约状态成功！");
    }

}
